package com.java_enum_goods;


import java.util.Scanner;

public class Store {


    public static void main(String[] args) {

            Goods goods1=new Goods("电风扇",124.23,1);
            Goods goods2=new Goods("洗衣机",4500.0,2);
            Goods goods3=new Goods("电视机",8800.9,3);
            Goods goods4=new Goods("冰箱",5000.88,4);
            Goods goods5=new Goods("空调机",4456.0,5);
            Goods[] goods=new Goods[]{goods1,goods2,goods3,goods4,goods5};
            Who who=new Who(goods);
        Who.print(goods);
        Scanner in=new Scanner(System.in);
        System.out.println("请输入批发商品编号：");
        int num=in.nextInt();
        System.out.println("请输入批发数量：");
        int count=in.nextInt();
     Double money=   Who.tatal(num,count);
     String str=money.toString();
     StringBuffer str1=new StringBuffer(str);
     int index=str1.indexOf(".");

        for (int i =index-3; i >0; i-=3) {
            str1.insert(i,",");

        }

        System.out.print("你需要付款："+   str1);


    }
}
